<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>axiethernet: xavb_ptp_bmca.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">axiethernet
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="pages.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xavb__ptp__bmca_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xavb_ptp_bmca.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>The <a class="el" href="struct_x_avb.html" title="The XAvb driver instance data. ">XAvb</a> driver. </p>
<p>Functions in this file all relate to the Best Master Clock Algorithm (BMCA) which is performed on the AVB network to select a network Grand Master Clock.</p>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who  Date     Changes
</p>
<hr/>
<p>
1.00a mbr  09/19/08 First release
1.01a mbr  06/24/09 PTP frame format updates for IEEE802.1 AS draft 5-0
2_02a mbr  09/16/09 Updates for programmable PTP timers
2_04a kag  07/23/10 PTP frame format updates for IEEE802.1 AS draft 6-7
3_01a kag  08/29/11 Added new APIs to update the RX Filter Control Reg.
              Fix for CR:572539. Updated bit map for Rx Filter
              control reg.</pre><pre></pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a4091121232495f00535ca134664b4f7c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xavb__ptp__bmca_8c.html#a4091121232495f00535ca134664b4f7c">XAvb_DecodeTxAnnounceFrame</a> (<a class="el" href="struct_x_avb.html">XAvb</a> *InstancePtr)</td></tr>
<tr class="memdesc:a4091121232495f00535ca134664b4f7c"><td class="mdescLeft">&#160;</td><td class="mdescRight">A New Announce Packet has been written to this device to transmit.  <a href="#a4091121232495f00535ca134664b4f7c">More...</a><br/></td></tr>
<tr class="separator:a4091121232495f00535ca134664b4f7c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5eaf575de699cb2f054a43daa8a93849"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xavb__ptp__bmca_8c.html#a5eaf575de699cb2f054a43daa8a93849">XAvb_DecodeRxAnnounceFrame</a> (<a class="el" href="struct_x_avb.html">XAvb</a> *InstancePtr, u32 PtpFrameBaseAddr)</td></tr>
<tr class="memdesc:a5eaf575de699cb2f054a43daa8a93849"><td class="mdescLeft">&#160;</td><td class="mdescRight">A New Announce Packet has been received.  <a href="#a5eaf575de699cb2f054a43daa8a93849">More...</a><br/></td></tr>
<tr class="separator:a5eaf575de699cb2f054a43daa8a93849"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7c77fd7953811584a36001e5e74165b3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xavb__ptp__bmca_8c.html#a7c77fd7953811584a36001e5e74165b3">XAvb_ReadAnnounceFrame</a> (u32 BaseAddress, u32 PtpFrameBaseAddr, <a class="el" href="struct_x_avb___bmc_data.html">XAvb_BmcData</a> *AnnounceFrame)</td></tr>
<tr class="memdesc:a7c77fd7953811584a36001e5e74165b3"><td class="mdescLeft">&#160;</td><td class="mdescRight">A New Announce Packet is to be analyzed.  <a href="#a7c77fd7953811584a36001e5e74165b3">More...</a><br/></td></tr>
<tr class="separator:a7c77fd7953811584a36001e5e74165b3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa66e9752ef47bf7eafe4784cb59e1093"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xavb__ptp__bmca_8c.html#aa66e9752ef47bf7eafe4784cb59e1093">XAvb_ReadAnnounceReceiptTimeout</a> (u32 BaseAddress, u32 PtpFrameBaseAddr, <a class="el" href="struct_x_avb___bmc_data.html">XAvb_BmcData</a> *AnnounceFrame)</td></tr>
<tr class="memdesc:aa66e9752ef47bf7eafe4784cb59e1093"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function reads the logMessageinteval from an RX PTP Buffer and updates the AnnounceFrame struct with the value read.  <a href="#aa66e9752ef47bf7eafe4784cb59e1093">More...</a><br/></td></tr>
<tr class="separator:aa66e9752ef47bf7eafe4784cb59e1093"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae38ec83a381d57348fdbaf065c2190eb"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xavb__ptp__bmca_8c.html#ae38ec83a381d57348fdbaf065c2190eb">XAvb_BestMasterClockAlgorithm</a> (<a class="el" href="struct_x_avb___bmc_data.html">XAvb_BmcData</a> *AnnounceFrame, <a class="el" href="struct_x_avb___bmc_data.html">XAvb_BmcData</a> *CurrentBmc)</td></tr>
<tr class="memdesc:ae38ec83a381d57348fdbaf065c2190eb"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function will accept the data pointer to the current BMCA records, accept a pointer to an equivalent data structure for the new Announce Packet.  <a href="#ae38ec83a381d57348fdbaf065c2190eb">More...</a><br/></td></tr>
<tr class="separator:ae38ec83a381d57348fdbaf065c2190eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2234b9dec3b039479123f49ee573a14e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xavb__ptp__bmca_8c.html#a2234b9dec3b039479123f49ee573a14e">XAvb_UpdateBmcRecords</a> (<a class="el" href="struct_x_avb___bmc_data.html">XAvb_BmcData</a> *NewMaster, <a class="el" href="struct_x_avb___bmc_data.html">XAvb_BmcData</a> *CurrentBmc)</td></tr>
<tr class="memdesc:a2234b9dec3b039479123f49ee573a14e"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function will accept the data pointer to the current BMCA records, accept an equivalent pointer to a new (winning) Grand Masters Announce Packet information.  <a href="#a2234b9dec3b039479123f49ee573a14e">More...</a><br/></td></tr>
<tr class="separator:a2234b9dec3b039479123f49ee573a14e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5ef1c55c51f5781c4395ff20cc07f410"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xavb__ptp__bmca_8c.html#a5ef1c55c51f5781c4395ff20cc07f410">XAvb_BecomeRtcMaster</a> (<a class="el" href="struct_x_avb.html">XAvb</a> *InstancePtr, u8 txAnnounceHasWon)</td></tr>
<tr class="memdesc:a5ef1c55c51f5781c4395ff20cc07f410"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function will make any adjustments needed when the node becomes the Grand Master, including resetting the RTC to its nominal value.  <a href="#a5ef1c55c51f5781c4395ff20cc07f410">More...</a><br/></td></tr>
<tr class="separator:a5ef1c55c51f5781c4395ff20cc07f410"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a52eb3269ef7daea39a316315d903c43c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xavb__ptp__bmca_8c.html#a52eb3269ef7daea39a316315d903c43c">XAvb_BecomeRtcSlave</a> (<a class="el" href="struct_x_avb.html">XAvb</a> *InstancePtr)</td></tr>
<tr class="memdesc:a52eb3269ef7daea39a316315d903c43c"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function will make any adjustments needed when the node becomes a PTP slave.  <a href="#a52eb3269ef7daea39a316315d903c43c">More...</a><br/></td></tr>
<tr class="separator:a52eb3269ef7daea39a316315d903c43c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a07f69b843cd86ca6149c838c478c4e01"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xavb__ptp__bmca_8c.html#a07f69b843cd86ca6149c838c478c4e01">XAvb_ChangePTPLockStatus</a> (<a class="el" href="struct_x_avb.html">XAvb</a> *InstancePtr, u8 locked)</td></tr>
<tr class="memdesc:a07f69b843cd86ca6149c838c478c4e01"><td class="mdescLeft">&#160;</td><td class="mdescRight">Operations needed when PTP locks or unlocks.  <a href="#a07f69b843cd86ca6149c838c478c4e01">More...</a><br/></td></tr>
<tr class="separator:a07f69b843cd86ca6149c838c478c4e01"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a004f6ae823f2e50f4dd2fac409953537"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xavb__ptp__bmca_8c.html#a004f6ae823f2e50f4dd2fac409953537">XAvb_ChangePeerASCapability</a> (<a class="el" href="struct_x_avb.html">XAvb</a> *InstancePtr, u8 capable)</td></tr>
<tr class="memdesc:a004f6ae823f2e50f4dd2fac409953537"><td class="mdescLeft">&#160;</td><td class="mdescRight">Operations needed when the peer's AS capability changes.  <a href="#a004f6ae823f2e50f4dd2fac409953537">More...</a><br/></td></tr>
<tr class="separator:a004f6ae823f2e50f4dd2fac409953537"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3c8e2297936bf5abb7f206b365611b30"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xavb__ptp__bmca_8c.html#a3c8e2297936bf5abb7f206b365611b30">XAvb_SetGMDiscontinuityHandler</a> (<a class="el" href="struct_x_avb.html">XAvb</a> *InstancePtr, <a class="el" href="xavb_8h.html#a89773b9c275933b3c03bbf78179342b5">XAvb_Handler</a> FuncPtr, void *CallBackRef)</td></tr>
<tr class="memdesc:a3c8e2297936bf5abb7f206b365611b30"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function sets the handler that will be called when a GM discontinuity event is identified by the driver.  <a href="#a3c8e2297936bf5abb7f206b365611b30">More...</a><br/></td></tr>
<tr class="separator:a3c8e2297936bf5abb7f206b365611b30"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a5ef1c55c51f5781c4395ff20cc07f410"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XAvb_BecomeRtcMaster </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_avb.html">XAvb</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>txAnnounceHasWon</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function will make any adjustments needed when the node becomes the Grand Master, including resetting the RTC to its nominal value. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_x_avb.html" title="The XAvb driver instance data. ">XAvb</a> instance to be worked on</td></tr>
    <tr><td class="paramname">txAnnounceHasWon</td><td>indicates that this function has been called from the function <a class="el" href="xavb_8h.html#a4091121232495f00535ca134664b4f7c" title="A New Announce Packet has been written to this device to transmit. ">XAvb_DecodeTxAnnounceFrame()</a>. Is this is set then this function has no need to repeat actions that have been already performed.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>
<p>Update the BMCA records to this device's information</p>
<p>Read the attributes in the Tx PTP buffer</p>
<p>Update records</p>
<p>reset the RTC to a nominal value</p>
<p>set timestamp uncertainty if new status</p>
<p>inform the rest of the system </p>

<p>References <a class="el" href="struct_x_avb___config.html#a8f161e4fe6ff1843746adbd93a173241">XAvb_Config::BaseAddress</a>, <a class="el" href="struct_x_avb.html#a004789c582ac680a57d708f86c13ab9f">XAvb::Config</a>, <a class="el" href="struct_x_avb.html#a81e68bbc2d63aab5e4d6a36bf7039f03">XAvb::CurrentBmc</a>, <a class="el" href="struct_x_avb.html#a6f2483d14031dc855c8cf27c796c122e">XAvb::GMDiscCallBackRef</a>, <a class="el" href="struct_x_avb.html#adaa9fca5f2df9e76794cb97f8bd1f307">XAvb::GMDiscHandler</a>, <a class="el" href="struct_x_avb___bmc_data.html#a7d3619e11c42446854d5438dab27e84a">XAvb_BmcData::IAmTheRtcMaster</a>, <a class="el" href="xavb_8h.html#a7c77fd7953811584a36001e5e74165b3">XAvb_ReadAnnounceFrame()</a>, <a class="el" href="xavb__hw_8h.html#aca5791394dd0b429d4c49559d0e1503c">XAVB_RTC_INCREMENT_NOMINAL_RATE</a>, <a class="el" href="xavb__hw_8h.html#a48d76d16f8d685a65a1216614e548071">XAVB_RTC_INCREMENT_OFFSET</a>, <a class="el" href="xavb_8h.html#a2234b9dec3b039479123f49ee573a14e">XAvb_UpdateBmcRecords()</a>, and <a class="el" href="xavb__hw_8h.html#a74f3dcc0fed12b1ee97541a109b8d98c">XAvb_WriteReg</a>.</p>

<p>Referenced by <a class="el" href="xavb__ptp__bmca_8c.html#a4091121232495f00535ca134664b4f7c">XAvb_DecodeTxAnnounceFrame()</a>, <a class="el" href="xavb_8h.html#aab96c1602bda46380e25d0bb03a8ac01">XAvb_PtpTimerInterruptHandler()</a>, and <a class="el" href="xavb_8h.html#af24c248c31c6c45cdb8a46f82de175c5">XAvb_Reset()</a>.</p>

</div>
</div>
<a class="anchor" id="a52eb3269ef7daea39a316315d903c43c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XAvb_BecomeRtcSlave </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_avb.html">XAvb</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function will make any adjustments needed when the node becomes a PTP slave. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_x_avb.html" title="The XAvb driver instance data. ">XAvb</a> instance to be worked on</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>
<p>set timestamp uncertainty if new status </p>

<p>References <a class="el" href="struct_x_avb___counters.html#a33a32af6ca968fac37957cbe9435f1db">XAvb_Counters::CounterSyncInterval</a>, <a class="el" href="struct_x_avb.html#a81e68bbc2d63aab5e4d6a36bf7039f03">XAvb::CurrentBmc</a>, <a class="el" href="struct_x_avb.html#a6f2483d14031dc855c8cf27c796c122e">XAvb::GMDiscCallBackRef</a>, <a class="el" href="struct_x_avb.html#adaa9fca5f2df9e76794cb97f8bd1f307">XAvb::GMDiscHandler</a>, <a class="el" href="struct_x_avb___bmc_data.html#a7d3619e11c42446854d5438dab27e84a">XAvb_BmcData::IAmTheRtcMaster</a>, and <a class="el" href="struct_x_avb.html#adfddd0be1695d91532dd7dc2ee5614e2">XAvb::PtpCounters</a>.</p>

<p>Referenced by <a class="el" href="xavb__ptp__bmca_8c.html#a5eaf575de699cb2f054a43daa8a93849">XAvb_DecodeRxAnnounceFrame()</a>.</p>

</div>
</div>
<a class="anchor" id="ae38ec83a381d57348fdbaf065c2190eb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 XAvb_BestMasterClockAlgorithm </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_avb___bmc_data.html">XAvb_BmcData</a> *&#160;</td>
          <td class="paramname"><em>AnnounceFrame</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_x_avb___bmc_data.html">XAvb_BmcData</a> *&#160;</td>
          <td class="paramname"><em>CurrentBmc</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function will accept the data pointer to the current BMCA records, accept a pointer to an equivalent data structure for the new Announce Packet. </p>
<p>The Best Master Clock Algorithm (BMCA) is then performed on these two data structures by comparing the data fields</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">CurrentBmc</td><td>is a pointer to a suitable data structure, designed to record the current fields from the current Grand Master's Announce Packet. </td></tr>
    <tr><td class="paramname">AnnounceFrame</td><td>is a pointer to a suitable data structure, designed to record the useful fields from the received Announce Packet</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>An updated True/False decision as to whether there is to be a change of Grand Master in the network.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>
<p>Priority1 takes precedence over all over priorites</p>
<p>we have found a better master!</p>
<p>convert structs to u32 values for easy comparison</p>
<p>ClockQuality has the next priority</p>
<p>we have found a better master!</p>
<p>Priority2 provides fine grained ordering amongst otherwise equal clocks</p>
<p>we have found a better master!</p>
<p>Next compare the Clock Identities</p>
<p>we have found a better master!</p>
<p>we have found a better master!</p>
<p>Next compare stepsRemoved</p>
<p>we have found a better master!</p>
<p>Next compare SourcePortIdentity</p>
<p>we have found a better master!</p>
<p>we have found a better master!</p>
<p>If all else fails, the SourcePortIdentity Port Number must act as the tie-breaker</p>
<p>A new master has won on the tie-break! </p>

<p>References <a class="el" href="struct_x_avb___clock_quality.html#ad4d7a7873966a1b940f6de4a7f3b5074">XAvb_ClockQuality::clockAccuracy</a>, <a class="el" href="struct_x_avb___clock_quality.html#a4102e4f3919f5ed91b62d45c2545c793">XAvb_ClockQuality::clockClass</a>, <a class="el" href="struct_x_avb___port_identity.html#ad7e78ca34d8fcbecf410f8d748177e0e">XAvb_PortIdentity::ClockIdentityLower</a>, <a class="el" href="struct_x_avb___clock_identity.html#a6119ed21ae13fc8002df3ea89701a710">XAvb_ClockIdentity::ClockIdentityLower</a>, <a class="el" href="struct_x_avb___port_identity.html#aa1435c872067f98c7998a4b98b792112">XAvb_PortIdentity::ClockIdentityUpper</a>, <a class="el" href="struct_x_avb___clock_identity.html#a6d7f51bcff1917d372465c04a2f36d7b">XAvb_ClockIdentity::ClockIdentityUpper</a>, <a class="el" href="struct_x_avb___bmc_data.html#a463904e4270ced5a6c437e68fad3b98f">XAvb_BmcData::ClockQuality</a>, <a class="el" href="struct_x_avb___bmc_data.html#aa842c05dfde7a1dccd0a48c906c742d9">XAvb_BmcData::GrandmasterIdentity</a>, <a class="el" href="struct_x_avb___bmc_data.html#a206dca9ffafe9d7fbf0019402127e6dd">XAvb_BmcData::GrandmasterPriority1</a>, <a class="el" href="struct_x_avb___bmc_data.html#ab345aec9e45cac47fddee9e48724c9ef">XAvb_BmcData::GrandmasterPriority2</a>, <a class="el" href="struct_x_avb___clock_quality.html#a8034a2fc43c4dcaadca3577cc7e9a7be">XAvb_ClockQuality::offsetScaledLogVariance</a>, <a class="el" href="struct_x_avb___port_identity.html#adbb184a9b5875775835442cf06a25800">XAvb_PortIdentity::PortNumber</a>, <a class="el" href="struct_x_avb___bmc_data.html#ae60a5e9cd8c572d2db805650287483f7">XAvb_BmcData::SourcePortIdentity</a>, and <a class="el" href="struct_x_avb___bmc_data.html#aa82e09ae59ed634e54fdcfebe78d10d2">XAvb_BmcData::stepsRemoved</a>.</p>

<p>Referenced by <a class="el" href="xavb__ptp__bmca_8c.html#a5eaf575de699cb2f054a43daa8a93849">XAvb_DecodeRxAnnounceFrame()</a>, and <a class="el" href="xavb__ptp__bmca_8c.html#a4091121232495f00535ca134664b4f7c">XAvb_DecodeTxAnnounceFrame()</a>.</p>

</div>
</div>
<a class="anchor" id="a004f6ae823f2e50f4dd2fac409953537"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XAvb_ChangePeerASCapability </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_avb.html">XAvb</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>capable</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Operations needed when the peer's AS capability changes. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_x_avb.html" title="The XAvb driver instance data. ">XAvb</a> instance to be worked on </td></tr>
    <tr><td class="paramname">capable</td><td>is 1 if the peer is ASCapable, 0 otherwise</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="struct_x_avb.html#a8311fd4524732cca626191f25591bfba">XAvb::PeerASCapable</a>.</p>

<p>Referenced by <a class="el" href="xavb_8h.html#a6d7814f965d4141992654954f1243679">XAvb_CalcDelay()</a>, <a class="el" href="xavb__ptp__bmca_8c.html#a07f69b843cd86ca6149c838c478c4e01">XAvb_ChangePTPLockStatus()</a>, <a class="el" href="xavb__ptp__packets_8c.html#acc5beb09f67f655b7eb8eb51b3cd2d8a">XAvb_DecodeRxPDelayResp()</a>, <a class="el" href="xavb_8h.html#aab96c1602bda46380e25d0bb03a8ac01">XAvb_PtpTimerInterruptHandler()</a>, <a class="el" href="xavb_8h.html#af24c248c31c6c45cdb8a46f82de175c5">XAvb_Reset()</a>, and <a class="el" href="xavb_8h.html#a8657704dc9974d465536615ebbeb79d9">XAvb_Start()</a>.</p>

</div>
</div>
<a class="anchor" id="a07f69b843cd86ca6149c838c478c4e01"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XAvb_ChangePTPLockStatus </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_avb.html">XAvb</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>locked</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Operations needed when PTP locks or unlocks. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_x_avb.html" title="The XAvb driver instance data. ">XAvb</a> instance to be worked on </td></tr>
    <tr><td class="paramname">locked</td><td>is 1 if changing to locked status, zero if unlocked</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>
<p>set status variable</p>
<p>set timestamp uncertainty if necessary </p>

<p>References <a class="el" href="struct_x_avb.html#a6f2483d14031dc855c8cf27c796c122e">XAvb::GMDiscCallBackRef</a>, <a class="el" href="struct_x_avb.html#adaa9fca5f2df9e76794cb97f8bd1f307">XAvb::GMDiscHandler</a>, <a class="el" href="struct_x_avb.html#a9ae7367366022ccb6d467da689de8e09">XAvb::PTPLocked</a>, and <a class="el" href="xavb_8h.html#a004f6ae823f2e50f4dd2fac409953537">XAvb_ChangePeerASCapability()</a>.</p>

<p>Referenced by <a class="el" href="xavb_8h.html#ada9dd75eb576b0e600686514fbea45e3">XAvb_UpdateRtcIncrement()</a>.</p>

</div>
</div>
<a class="anchor" id="a5eaf575de699cb2f054a43daa8a93849"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XAvb_DecodeRxAnnounceFrame </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_avb.html">XAvb</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>PtpFrameBaseAddr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>A New Announce Packet has been received. </p>
<p>We need to decode it and rerun the Best Master Clock Algorithm (BMCA)</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_x_avb.html" title="The XAvb driver instance data. ">XAvb</a> instance to be worked on </td></tr>
    <tr><td class="paramname">PtpFrameBaseAddr</td><td>is the base address of the received Announce Packet in the Rx PTP Packet Buffer</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None. But an updated True/False decision as to whether this device should operate as a clock master or a slave is written into the CurrentBmc data structure.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>
<p>Read the attributes for the new Announce frame received</p>
<p>If the received packet's clockIdentity matches our clockIdentity, ignore the packet</p>
<p>If the received packet's stepsRemoved field is &gt;= 255, ignore the packet</p>
<p>If the Announce packet's GMID matches that of our current GM record, then update its records based on the current packet, just in case something (such as priority) has changed.</p>
<p>update timeout information</p>
<p>Compare against this device's information to see if we should be GM</p>
<p>run BMCA on this announce to see if it is better than me</p>
<p>Update records with the NEW best master</p>
<p>Capture the Announce Receipt Timeout Interval. Reset the announce receipt timeout interval to use the new value.</p>
<p>New Rx Announce Packet has won - so this device cannot be a master </p>

<p>References <a class="el" href="struct_x_avb___bmc_data.html#af3bcc274ccdd364fe5983d586b5cff62">XAvb_BmcData::AnnounceIntervalDuration</a>, <a class="el" href="struct_x_avb___config.html#a8f161e4fe6ff1843746adbd93a173241">XAvb_Config::BaseAddress</a>, <a class="el" href="struct_x_avb___clock_quality.html#a4102e4f3919f5ed91b62d45c2545c793">XAvb_ClockQuality::clockClass</a>, <a class="el" href="struct_x_avb___clock_identity.html#a6119ed21ae13fc8002df3ea89701a710">XAvb_ClockIdentity::ClockIdentityLower</a>, <a class="el" href="struct_x_avb___clock_identity.html#a6d7f51bcff1917d372465c04a2f36d7b">XAvb_ClockIdentity::ClockIdentityUpper</a>, <a class="el" href="struct_x_avb___bmc_data.html#a463904e4270ced5a6c437e68fad3b98f">XAvb_BmcData::ClockQuality</a>, <a class="el" href="struct_x_avb.html#a004789c582ac680a57d708f86c13ab9f">XAvb::Config</a>, <a class="el" href="struct_x_avb___counters.html#af9de244165a5492b2ee9b90a625a7922">XAvb_Counters::CounterAnnounceInterval</a>, <a class="el" href="struct_x_avb.html#a81e68bbc2d63aab5e4d6a36bf7039f03">XAvb::CurrentBmc</a>, <a class="el" href="struct_x_avb___bmc_data.html#aa842c05dfde7a1dccd0a48c906c742d9">XAvb_BmcData::GrandmasterIdentity</a>, <a class="el" href="struct_x_avb___bmc_data.html#a206dca9ffafe9d7fbf0019402127e6dd">XAvb_BmcData::GrandmasterPriority1</a>, <a class="el" href="struct_x_avb___bmc_data.html#ab345aec9e45cac47fddee9e48724c9ef">XAvb_BmcData::GrandmasterPriority2</a>, <a class="el" href="struct_x_avb___bmc_data.html#a7d3619e11c42446854d5438dab27e84a">XAvb_BmcData::IAmTheRtcMaster</a>, <a class="el" href="struct_x_avb___bmc_data.html#ae1a43181c99b74fbac809dc9b833509e">XAvb_BmcData::logMessageInterval</a>, <a class="el" href="struct_x_avb.html#afa0f0b3779f43a549fc63b1c9d6e9f23">XAvb::portIdLocal</a>, <a class="el" href="struct_x_avb.html#adfddd0be1695d91532dd7dc2ee5614e2">XAvb::PtpCounters</a>, <a class="el" href="struct_x_avb___bmc_data.html#ae60a5e9cd8c572d2db805650287483f7">XAvb_BmcData::SourcePortIdentity</a>, <a class="el" href="struct_x_avb___bmc_data.html#aa82e09ae59ed634e54fdcfebe78d10d2">XAvb_BmcData::stepsRemoved</a>, <a class="el" href="xavb_8h.html#a52eb3269ef7daea39a316315d903c43c">XAvb_BecomeRtcSlave()</a>, <a class="el" href="xavb_8h.html#ae38ec83a381d57348fdbaf065c2190eb">XAvb_BestMasterClockAlgorithm()</a>, <a class="el" href="xavb_8h.html#aa03b2f45590d8dabe5ad0eb39430e044">XAvb_CompareClockIdentity()</a>, <a class="el" href="xavb_8h.html#a8231a4001187aaff164037da857cb333">XAvb_ComparePortIdentity()</a>, <a class="el" href="xavb_8h.html#afa725e8ddb08a833d10e8554067ac361">XAvb_ConvertLogMeanToDuration()</a>, <a class="el" href="xavb_8h.html#a4091121232495f00535ca134664b4f7c">XAvb_DecodeTxAnnounceFrame()</a>, <a class="el" href="xavb_8h.html#a7c77fd7953811584a36001e5e74165b3">XAvb_ReadAnnounceFrame()</a>, <a class="el" href="xavb_8h.html#aa66e9752ef47bf7eafe4784cb59e1093">XAvb_ReadAnnounceReceiptTimeout()</a>, and <a class="el" href="xavb_8h.html#a2234b9dec3b039479123f49ee573a14e">XAvb_UpdateBmcRecords()</a>.</p>

<p>Referenced by <a class="el" href="xavb_8h.html#a99019d3795040dd7110d47aaa598ab7b">XAvb_PtpRxInterruptHandler()</a>.</p>

</div>
</div>
<a class="anchor" id="a4091121232495f00535ca134664b4f7c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XAvb_DecodeTxAnnounceFrame </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_avb.html">XAvb</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>A New Announce Packet has been written to this device to transmit. </p>
<p>We need to decode it and rerun the Best Master Clock Algorithm (BMCA)</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_x_avb.html" title="The XAvb driver instance data. ">XAvb</a> instance to be worked on</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None. But an updated True/False decision as to whether this device should operate as a clock master or a slave is written into the CurrentBmc data structure.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>
<p>Read the attributes for the new Announce frame in the Tx PTP buffer</p>
<p>Compare the clock attributes between then new Announce frame and the current master</p>
<p>Update records with the NEW best master</p>
<p>Our new Tx Announce Packet has won - so this device must be the master </p>

<p>References <a class="el" href="struct_x_avb___config.html#a8f161e4fe6ff1843746adbd93a173241">XAvb_Config::BaseAddress</a>, <a class="el" href="struct_x_avb___clock_quality.html#a4102e4f3919f5ed91b62d45c2545c793">XAvb_ClockQuality::clockClass</a>, <a class="el" href="struct_x_avb___clock_identity.html#a6119ed21ae13fc8002df3ea89701a710">XAvb_ClockIdentity::ClockIdentityLower</a>, <a class="el" href="struct_x_avb___clock_identity.html#a6d7f51bcff1917d372465c04a2f36d7b">XAvb_ClockIdentity::ClockIdentityUpper</a>, <a class="el" href="struct_x_avb___bmc_data.html#a463904e4270ced5a6c437e68fad3b98f">XAvb_BmcData::ClockQuality</a>, <a class="el" href="struct_x_avb.html#a004789c582ac680a57d708f86c13ab9f">XAvb::Config</a>, <a class="el" href="struct_x_avb.html#a81e68bbc2d63aab5e4d6a36bf7039f03">XAvb::CurrentBmc</a>, <a class="el" href="struct_x_avb___bmc_data.html#aa842c05dfde7a1dccd0a48c906c742d9">XAvb_BmcData::GrandmasterIdentity</a>, <a class="el" href="struct_x_avb___bmc_data.html#a206dca9ffafe9d7fbf0019402127e6dd">XAvb_BmcData::GrandmasterPriority1</a>, <a class="el" href="struct_x_avb___bmc_data.html#ab345aec9e45cac47fddee9e48724c9ef">XAvb_BmcData::GrandmasterPriority2</a>, <a class="el" href="struct_x_avb___bmc_data.html#a7d3619e11c42446854d5438dab27e84a">XAvb_BmcData::IAmTheRtcMaster</a>, <a class="el" href="xavb_8h.html#a5ef1c55c51f5781c4395ff20cc07f410">XAvb_BecomeRtcMaster()</a>, <a class="el" href="xavb_8h.html#ae38ec83a381d57348fdbaf065c2190eb">XAvb_BestMasterClockAlgorithm()</a>, <a class="el" href="xavb_8h.html#a7c77fd7953811584a36001e5e74165b3">XAvb_ReadAnnounceFrame()</a>, and <a class="el" href="xavb_8h.html#a2234b9dec3b039479123f49ee573a14e">XAvb_UpdateBmcRecords()</a>.</p>

<p>Referenced by <a class="el" href="xavb__ptp__bmca_8c.html#a5eaf575de699cb2f054a43daa8a93849">XAvb_DecodeRxAnnounceFrame()</a>, and <a class="el" href="xavb_8h.html#a8657704dc9974d465536615ebbeb79d9">XAvb_Start()</a>.</p>

</div>
</div>
<a class="anchor" id="a7c77fd7953811584a36001e5e74165b3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XAvb_ReadAnnounceFrame </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>BaseAddress</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>PtpFrameBaseAddr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_x_avb___bmc_data.html">XAvb_BmcData</a> *&#160;</td>
          <td class="paramname"><em>AnnounceFrame</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>A New Announce Packet is to be analyzed. </p>
<p>This function will read in the packet, decode it, and extract the relevant information fields to the "AnnounceFrame" data pointer.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">BaseAddress</td><td>is the base address of the device </td></tr>
    <tr><td class="paramname">PtpFrameBaseAddr</td><td>is the base address of the received Announce Packet in the Rx PTP Packet Buffer </td></tr>
    <tr><td class="paramname">AnnounceFrame</td><td>is a pointer to a suitable data structure, designed to record the useful fields from the received Announce Packet</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The AnnounceFrame data structure is updated.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>
<p>Get the Source Port Identity of the port sending the Announce Packet</p>
<p>Read priority1 and top half of ClockQuality</p>
<p>Read bottom half of ClockQuality, priority2, and top byte of GMID</p>
<p>Read bytes 4-7 of GMID</p>
<p>Read bytes 1-3 of GMID and high byte of stepsRemoved</p>
<p>Read low byte of stepsRemoved </p>

<p>References <a class="el" href="struct_x_avb___clock_quality.html#ad4d7a7873966a1b940f6de4a7f3b5074">XAvb_ClockQuality::clockAccuracy</a>, <a class="el" href="struct_x_avb___clock_quality.html#a4102e4f3919f5ed91b62d45c2545c793">XAvb_ClockQuality::clockClass</a>, <a class="el" href="struct_x_avb___port_identity.html#ad7e78ca34d8fcbecf410f8d748177e0e">XAvb_PortIdentity::ClockIdentityLower</a>, <a class="el" href="struct_x_avb___clock_identity.html#a6119ed21ae13fc8002df3ea89701a710">XAvb_ClockIdentity::ClockIdentityLower</a>, <a class="el" href="struct_x_avb___port_identity.html#aa1435c872067f98c7998a4b98b792112">XAvb_PortIdentity::ClockIdentityUpper</a>, <a class="el" href="struct_x_avb___clock_identity.html#a6d7f51bcff1917d372465c04a2f36d7b">XAvb_ClockIdentity::ClockIdentityUpper</a>, <a class="el" href="struct_x_avb___bmc_data.html#a463904e4270ced5a6c437e68fad3b98f">XAvb_BmcData::ClockQuality</a>, <a class="el" href="struct_x_avb___bmc_data.html#aa842c05dfde7a1dccd0a48c906c742d9">XAvb_BmcData::GrandmasterIdentity</a>, <a class="el" href="struct_x_avb___bmc_data.html#a206dca9ffafe9d7fbf0019402127e6dd">XAvb_BmcData::GrandmasterPriority1</a>, <a class="el" href="struct_x_avb___bmc_data.html#ab345aec9e45cac47fddee9e48724c9ef">XAvb_BmcData::GrandmasterPriority2</a>, <a class="el" href="struct_x_avb___clock_quality.html#a8034a2fc43c4dcaadca3577cc7e9a7be">XAvb_ClockQuality::offsetScaledLogVariance</a>, <a class="el" href="struct_x_avb___bmc_data.html#ae60a5e9cd8c572d2db805650287483f7">XAvb_BmcData::SourcePortIdentity</a>, <a class="el" href="struct_x_avb___bmc_data.html#aa82e09ae59ed634e54fdcfebe78d10d2">XAvb_BmcData::stepsRemoved</a>, <a class="el" href="xavb_8h.html#a2f2030902e6748712f30a59a62dff010">XAvb_GetPortIdentity()</a>, <a class="el" href="xavb__hw_8h.html#a072d5c22a5ff3e25e036146d552955bc">XAvb_ReadPtpBuffer</a>, and <a class="el" href="xavb_8h.html#a664d83b2f34093d6000f3ea2facef449">XAvb_ReorderWord()</a>.</p>

<p>Referenced by <a class="el" href="xavb__ptp__bmca_8c.html#a5ef1c55c51f5781c4395ff20cc07f410">XAvb_BecomeRtcMaster()</a>, <a class="el" href="xavb__ptp__bmca_8c.html#a5eaf575de699cb2f054a43daa8a93849">XAvb_DecodeRxAnnounceFrame()</a>, and <a class="el" href="xavb__ptp__bmca_8c.html#a4091121232495f00535ca134664b4f7c">XAvb_DecodeTxAnnounceFrame()</a>.</p>

</div>
</div>
<a class="anchor" id="aa66e9752ef47bf7eafe4784cb59e1093"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XAvb_ReadAnnounceReceiptTimeout </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>BaseAddress</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>PtpFrameBaseAddr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_x_avb___bmc_data.html">XAvb_BmcData</a> *&#160;</td>
          <td class="paramname"><em>AnnounceFrame</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function reads the logMessageinteval from an RX PTP Buffer and updates the AnnounceFrame struct with the value read. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">BaseAddress</td><td>is the base address of the device </td></tr>
    <tr><td class="paramname">PtpFrameBaseAddr</td><td>is the base address of the received Announce Packet in the Rx PTP Packet Buffer </td></tr>
    <tr><td class="paramname">AnnounceFrame</td><td>is a pointer to a suitable data structure, designed to record the useful fields from the received Announce Packet</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The AnnounceFrame data structure is updated.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="struct_x_avb___bmc_data.html#ae1a43181c99b74fbac809dc9b833509e">XAvb_BmcData::logMessageInterval</a>, <a class="el" href="xavb__hw_8h.html#a072d5c22a5ff3e25e036146d552955bc">XAvb_ReadPtpBuffer</a>, and <a class="el" href="xavb_8h.html#a664d83b2f34093d6000f3ea2facef449">XAvb_ReorderWord()</a>.</p>

<p>Referenced by <a class="el" href="xavb__ptp__bmca_8c.html#a5eaf575de699cb2f054a43daa8a93849">XAvb_DecodeRxAnnounceFrame()</a>.</p>

</div>
</div>
<a class="anchor" id="a3c8e2297936bf5abb7f206b365611b30"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XAvb_SetGMDiscontinuityHandler </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_avb.html">XAvb</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="xavb_8h.html#a89773b9c275933b3c03bbf78179342b5">XAvb_Handler</a>&#160;</td>
          <td class="paramname"><em>FuncPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>CallBackRef</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function sets the handler that will be called when a GM discontinuity event is identified by the driver. </p>
<p>The purpose of the handler is to allow application specific processing to be performed.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_x_avb.html" title="The XAvb driver instance data. ">XAvb</a> instance. </td></tr>
    <tr><td class="paramname">FuncPtr</td><td>is the pointer to the callback function. </td></tr>
    <tr><td class="paramname">CallBackRef</td><td>is the upper layer callback reference passed back when the callback function is invoked.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>There is no assert on the CallBackRef since the driver doesn't know what it is (nor should it) </dd></dl>

<p>References <a class="el" href="struct_x_avb.html#a6f2483d14031dc855c8cf27c796c122e">XAvb::GMDiscCallBackRef</a>, <a class="el" href="struct_x_avb.html#adaa9fca5f2df9e76794cb97f8bd1f307">XAvb::GMDiscHandler</a>, and <a class="el" href="struct_x_avb.html#aced8bd4c1c2fe81821504bc65e8774eb">XAvb::IsReady</a>.</p>

<p>Referenced by <a class="el" href="xavb__example_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main()</a>.</p>

</div>
</div>
<a class="anchor" id="a2234b9dec3b039479123f49ee573a14e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XAvb_UpdateBmcRecords </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_avb___bmc_data.html">XAvb_BmcData</a> *&#160;</td>
          <td class="paramname"><em>NewMaster</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_x_avb___bmc_data.html">XAvb_BmcData</a> *&#160;</td>
          <td class="paramname"><em>CurrentBmc</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function will accept the data pointer to the current BMCA records, accept an equivalent pointer to a new (winning) Grand Masters Announce Packet information. </p>
<p>The CurrentBmc data structure is then updated with the information from the NewMaster.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">NewMaster</td><td>is a pointer to a suitable data structure which has recorded the relevant Announce Packet fields of the new (winning) Grand Master. </td></tr>
    <tr><td class="paramname">CurrentBmc</td><td>is a pointer to a suitable data structure which has recorded the current fields of the current Grand Master's Announce Packet.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The CurrentBmc data structure is updated.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="struct_x_avb___port_identity.html#ad7e78ca34d8fcbecf410f8d748177e0e">XAvb_PortIdentity::ClockIdentityLower</a>, <a class="el" href="struct_x_avb___clock_identity.html#a6119ed21ae13fc8002df3ea89701a710">XAvb_ClockIdentity::ClockIdentityLower</a>, <a class="el" href="struct_x_avb___port_identity.html#aa1435c872067f98c7998a4b98b792112">XAvb_PortIdentity::ClockIdentityUpper</a>, <a class="el" href="struct_x_avb___clock_identity.html#a6d7f51bcff1917d372465c04a2f36d7b">XAvb_ClockIdentity::ClockIdentityUpper</a>, <a class="el" href="struct_x_avb___bmc_data.html#a463904e4270ced5a6c437e68fad3b98f">XAvb_BmcData::ClockQuality</a>, <a class="el" href="struct_x_avb___bmc_data.html#aa842c05dfde7a1dccd0a48c906c742d9">XAvb_BmcData::GrandmasterIdentity</a>, <a class="el" href="struct_x_avb___bmc_data.html#a206dca9ffafe9d7fbf0019402127e6dd">XAvb_BmcData::GrandmasterPriority1</a>, <a class="el" href="struct_x_avb___bmc_data.html#ab345aec9e45cac47fddee9e48724c9ef">XAvb_BmcData::GrandmasterPriority2</a>, <a class="el" href="struct_x_avb___port_identity.html#adbb184a9b5875775835442cf06a25800">XAvb_PortIdentity::PortNumber</a>, <a class="el" href="struct_x_avb___bmc_data.html#ae60a5e9cd8c572d2db805650287483f7">XAvb_BmcData::SourcePortIdentity</a>, and <a class="el" href="struct_x_avb___bmc_data.html#aa82e09ae59ed634e54fdcfebe78d10d2">XAvb_BmcData::stepsRemoved</a>.</p>

<p>Referenced by <a class="el" href="xavb__ptp__bmca_8c.html#a5ef1c55c51f5781c4395ff20cc07f410">XAvb_BecomeRtcMaster()</a>, <a class="el" href="xavb__ptp__bmca_8c.html#a5eaf575de699cb2f054a43daa8a93849">XAvb_DecodeRxAnnounceFrame()</a>, and <a class="el" href="xavb__ptp__bmca_8c.html#a4091121232495f00535ca134664b4f7c">XAvb_DecodeTxAnnounceFrame()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
